package com.xiaoyi.intentsdklibrary.Bean;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class IntentBeanDao extends AbstractDao<IntentBean, Long> {
    public static final String TABLENAME = "INTENT_BEAN";

    public static class Properties {
        public static final Property Exemaple = new Property(5, String.class, "Exemaple", false, "EXEMAPLE");
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property IntentGroup = new Property(1, String.class, "IntentGroup", false, "INTENT_GROUP");
        public static final Property IntentID = new Property(3, String.class, "IntentID", false, "INTENT_ID");
        public static final Property IntentName = new Property(2, String.class, "IntentName", false, "INTENT_NAME");
        public static final Property Level = new Property(6, String.class, "Level", false, "LEVEL");
        public static final Property Regex = new Property(4, String.class, "Regex", false, "REGEX");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public IntentBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public IntentBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"INTENT_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"INTENT_GROUP\" TEXT,\"INTENT_NAME\" TEXT,\"INTENT_ID\" TEXT UNIQUE ,\"REGEX\" TEXT,\"EXEMAPLE\" TEXT,\"LEVEL\" TEXT);");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"INTENT_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, IntentBean intentBean) {
        databaseStatement.clearBindings();
        Long id = intentBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String intentGroup = intentBean.getIntentGroup();
        if (intentGroup != null) {
            databaseStatement.bindString(2, intentGroup);
        }
        String intentName = intentBean.getIntentName();
        if (intentName != null) {
            databaseStatement.bindString(3, intentName);
        }
        String intentID = intentBean.getIntentID();
        if (intentID != null) {
            databaseStatement.bindString(4, intentID);
        }
        String regex = intentBean.getRegex();
        if (regex != null) {
            databaseStatement.bindString(5, regex);
        }
        String exemaple = intentBean.getExemaple();
        if (exemaple != null) {
            databaseStatement.bindString(6, exemaple);
        }
        String level = intentBean.getLevel();
        if (level != null) {
            databaseStatement.bindString(7, level);
        }
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, IntentBean intentBean) {
        sQLiteStatement.clearBindings();
        Long id = intentBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String intentGroup = intentBean.getIntentGroup();
        if (intentGroup != null) {
            sQLiteStatement.bindString(2, intentGroup);
        }
        String intentName = intentBean.getIntentName();
        if (intentName != null) {
            sQLiteStatement.bindString(3, intentName);
        }
        String intentID = intentBean.getIntentID();
        if (intentID != null) {
            sQLiteStatement.bindString(4, intentID);
        }
        String regex = intentBean.getRegex();
        if (regex != null) {
            sQLiteStatement.bindString(5, regex);
        }
        String exemaple = intentBean.getExemaple();
        if (exemaple != null) {
            sQLiteStatement.bindString(6, exemaple);
        }
        String level = intentBean.getLevel();
        if (level != null) {
            sQLiteStatement.bindString(7, level);
        }
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public IntentBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string3 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = i + 4;
        String string4 = cursor.isNull(i6) ? null : cursor.getString(i6);
        int i7 = i + 5;
        int i8 = i + 6;
        return new IntentBean(valueOf, string, string2, string3, string4, cursor.isNull(i7) ? null : cursor.getString(i7), cursor.isNull(i8) ? null : cursor.getString(i8));
    }

    public void readEntity(Cursor cursor, IntentBean intentBean, int i) {
        int i2 = i + 0;
        String str = null;
        intentBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        intentBean.setIntentGroup(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        intentBean.setIntentName(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        intentBean.setIntentID(cursor.isNull(i5) ? null : cursor.getString(i5));
        int i6 = i + 4;
        intentBean.setRegex(cursor.isNull(i6) ? null : cursor.getString(i6));
        int i7 = i + 5;
        intentBean.setExemaple(cursor.isNull(i7) ? null : cursor.getString(i7));
        int i8 = i + 6;
        if (!cursor.isNull(i8)) {
            str = cursor.getString(i8);
        }
        intentBean.setLevel(str);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(IntentBean intentBean, long j) {
        intentBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(IntentBean intentBean) {
        if (intentBean != null) {
            return intentBean.getId();
        }
        return null;
    }

    public boolean hasKey(IntentBean intentBean) {
        return intentBean.getId() != null;
    }
}
